<script setup lang="ts">
import { usePaginationStore } from '@/store/modules/pagination'
// import { ref } from 'vue'

const usePaginaStore = usePaginationStore()
const handleCurrentChange = (newCurrentPage: number) => {
  usePaginaStore.currentPage = newCurrentPage
  props.selectName && props.search ? props.searchUser() : props.getStuTable()
}
const handleSizeChange = (newPageSize: number) => {
  usePaginaStore.pageSize = newPageSize
  props.selectName && props.search ? props.searchUser() : props.getStuTable()
}
const props = defineProps([
  'isDelete',
  'search',
  'selectName',
  'getStuTable',
  'searchUser'
])
</script>

<template>
  <el-pagination
    v-show="isDelete && isDelete.length > 0"
    style="margin-top: 15px"
    v-model:current-page="usePaginaStore.currentPage"
    v-model:page-size="usePaginaStore.pageSize"
    :page-sizes="[5, 7, 10, 15]"
    background
    layout="total, prev, pager, next, -> ,sizes, jumper"
    :total="usePaginaStore.total"
    @size-change="handleSizeChange"
    @current-change="handleCurrentChange"
  />
</template>

<style scoped lang="scss"></style>
